package controller;

import java.util.HashMap;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import service.MissionService;
import vo.MemberVO;
import vo.MissionVO;
@Controller
public class MissionController {
	@Resource(name="missionServiceImpl")
	private MissionService missionService;
	
	@RequestMapping("stepup_mission.sds")
	public String rankPage(){
		return "stepup_mission" ;
	}
	
	/*@RequestMapping("stepup_mission_list.sds")
	@ResponseBody
	public HashMap mission(HttpSession session){
		
		System.out.println("ctrl mission");
		HashMap map = missionService.mission();
		
		System.out.println("map: " + map);
		
		return map;
	}*/
	
	@RequestMapping("stepup_mission_list.sds")
	@ResponseBody
	public HashMap mission(HttpSession session){
		MemberVO mvo = (MemberVO) session.getAttribute("loginMember");
		List<MissionVO> list = missionService.getMissionList(mvo);
		HashMap map = new HashMap();
		map.put("missionlist", list);
		System.out.println(map);
		return map;
	}
	
}
